package com.yuandian.management.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.business_monitor.entity.BusinessResource;
import com.yuandian.api.management.entity.ConfResource;
import com.yuandian.bpm.common.data.datascope.BpmBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 服务资源表-Mapper接口
 * @author zfsn
 * @date 2023-3-17
 */
@Mapper
public interface ConfResourceMapper extends BpmBaseMapper<ConfResource> {

	/**
	 * 分页查询
	 *
	 * @param page         分页对象
	 * @param confResource 筛选条件
	 * @return 通用返回对象
	 */
    Page<ConfResource> listPage(Page<ConfResource> page, @Param("params") ConfResource confResource);

	/**
	 * 根据状态查询业务服务资源编码
	 * @param status
	 * @return
	 */
	List<ConfResource> queryResourceCodeByStatus(@Param("status") Integer status);



	/**
	 *  更新业务服务资源为未使用，用网端服务资源url模糊匹配
	 * @param resourceStr
	 */
	void updateBusinessResourceNoUsed(@Param("resourceStr")String resourceStr);

    int updateByResourceCodes(@Param("resourceStr") BusinessResource businessResource);
}